package org.example.feign.interceptor;

import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.UUID;

public class ProducerFeignInterceptor implements RequestInterceptor {
    private static final Logger LOGGER = LoggerFactory.getLogger(ProducerFeignInterceptor.class);

    @Override
    public void apply(RequestTemplate template) {
        template.header("X-Auth-Token", UUID.randomUUID().toString());
        LOGGER.info("X-Auth-Token added.");
    }
}
